<template>
  <div class="phonics">
    <img src="../assets/images/pic3.png" alt class="cover-pic">
    <h2 class="phoics-title">课程列表</h2>
    <div class="list">
      <ul>
        <li v-for="(item,index) in list" :key="item.id" @click="toDetail(index)">
          <div class="list-box">
            <p class="which-section" :class="[item.status==2?'colorcc':'']">第 {{item.sesion}} 节</p>
            <div class="list-right">
              <p class="list-title">
                <strong :class="[item.status==2?'colorcc':'']">{{item.name}}</strong>
                <span class="status green" v-if="item.status==0">继续学习</span>
                <span class="status red" v-else-if="item.status==1">去学习</span>
                 <span class="status gray" v-else-if="item.status==2">已学完</span>
              </p>
            </div>
          </div>
          <p class="prompt" v-if="item.status==2">温故而知新哦~</p>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: [
        { sesion: 1, name: "学习字母p和b的发音", status: 0 },
        {
          sesion: 1,
          name: "学习字母p和b的发音",
          status: 1
        },
        { sesion: 1, name: "学习字母p和b的发音", status: 0 },
        { sesion: 1, name: "学习字母p和b的发音", status: 1 },
        { sesion: 1, name: "学习字母p和b的发音", status: 2 },
        {
          sesion: 1,
          name: "学习字母p和b的发音",
          status: 2
        },
        { sesion: 1, name: "学习字母p和b的发音", status: 2 },
        { sesion: 1, name: "学习字母p和b的发音", status: 2 }
      ]
    };
  },
  methods:{
    toDetail () {
      this.$router.push({path:'/CourseDetail'})
    }
  }
};
</script>

<style lang="scss" scoped>
.cover-pic {
  width: 100%;
  height: 4.14rem;
  margin-bottom: 0.45rem;
}
.phoics-title {
  font-size: 0.28rem;
  color: #666;
  margin-bottom: 0.2rem;
  padding-left: 3%;
   font-family: "微软雅黑";
}
.list {
  margin-bottom: 1rem;
  ul {
    li {
      //   height: 1.7rem;

      border-radius: 0.3rem;
      width: 94%;
      margin-left: 3%;
      margin-right: 3%;

      //   justify-content: space-between;
    
      margin-bottom: 0.2rem;
      .prompt {
        padding-top: 0.2rem;
        padding-bottom: 0.1rem;
        text-align: center;
        color: #999;
        font-size: .20rem;
        font-family: "微软雅黑";
      }
      .list-box {
        display: flex;
        display: -webkit-flex;
        -webkit-align-items: center;
        background: #fff;
          padding: 0.47rem 0;
      }
      p.which-section {
        font-size: 0.32rem;
        color: #333;
        width: 1.5rem;
        padding-left: 0.36rem;
        font-family: "微软雅黑";
      }
      .list-right {
        flex: 1;
        -webkit-flex: 1;
        display: flex;
        display: -webkit-flex;
        margin-right: 0.36rem;
        font-family: "微软雅黑";
      }
      .status {
        display: inline-block;
        padding: 0.05rem 0.2rem;
        border-radius: 0.3rem;
         font-size: 0.2rem;
        color: #fff;
        font-family: "微软雅黑";
        vertical-align: middle;
      }
      .green {
        background: #34d62c;
      }
      p.list-title {
        flex: 1;
        -webkit-flex: 1;
        line-height: 160%;
        strong {
          font-size: 0.32rem;
          color: #333;
        }
      }
      .red {
        background: #ff6422;
      }
      .colorcc {
          color: #999!important;
      }
      .gray {
          background: #ccc;
       
      }
    }
  }
}
</style>

